package singleton;

import lombok.extern.slf4j.Slf4j;

/**
 * @author zenghy
 **/
@Slf4j
public class SingletonObject {

    private static SingletonObject singletonObject;

    private SingletonObject() {
    }

    public static SingletonObject getInstance() {
        synchronized (SingletonObject.class) {
            if (null == singletonObject) {
                singletonObject = new SingletonObject();
            }
        }
        return singletonObject;
    }

    public void sayHi() {
        log.info("i am singleton object");
    }
}
